<?php 
//to render shopping cart total and article count in each page
require("storescripts/cart_script.php");
//execute register_script
require("storescripts/register_script.php");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Register</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<!-- start of javascript -->
<script type="text/javascript" language="javascript"> 
// validating forms before processing to a PHP script
function validateMyForm ( ) { 
    var isValid = true;
    if ( document.myForm.username.value == "" ) { 
	    alert ( "Please indicate username" ); 
	    isValid = false;
    } else if ( document.myForm.pass.value == "" ) { 
				alert ( "Please indicate password" ); 
				isValid = false;
	} else if ( document.myForm.pass2.value == "" ) { 
            alert ( "Please confirm password" ); 
            isValid = false;
    } else if ( document.myForm.pass.value != document.myForm.pass2.value ) { 
		            alert ( "Passwords don't match." ); 
		            isValid = false;
	} else if ( document.myForm.fname.value == "" ) { 
		            alert ( "Please indicate first name" ); 
		            isValid = false;
	} else if ( document.myForm.lname.value == "" ) { 
            alert ( "Please indicate last name" ); 
            isValid = false;
    } else if ( document.myForm.addr.value == "" ) { 
		     alert ( "Please indicate address" ); 
		     isValid = false;
	} else if ( document.myForm.email.value == "" ) { 
			 alert ( "Please indicate email" ); 
		 	 isValid = false;
	}
    return isValid;
}
</script>
<!--end of script -->
</head>
<body>
<!-- Shell -->
<div class="shell">
  <!-- Header -->
  <div id="header">
    <h1 id="logo"><a href="index.php">Luvo Fashion</a></h1>
    <!-- Cart -->
    <div id="cart"> <a href="cart.php" class="cart-link">Your Shopping Cart</a>
      <div class="cl">&nbsp;</div>
      <span>Articles: <strong><?php echo $cartArticles;?></strong></span> &nbsp;<span><strong><?php echo $cartTotal;?></strong></span> 
	</div>
    <!-- End Cart -->
    <!-- Navigation -->
    <div id="navigation">
      <ul>
        <li><a href="index.php">Home</a></li>
        <li><a href="about_us.php">About Us</a></li>
        <li><a href="faq.php">FAQ</a></li>
		<li><a href="gallery.php">Gallery</a></li>
        <li><a href="contact.php">Contact</a></li>
		<li><a href="customer_login.php"  class="active">My Account</a></li>
      </ul>
    </div>
    <!-- End Navigation -->
  </div>
  <!-- End Header -->
  <!-- Main -->
  <div id="main">
    <div class="cl">&nbsp;</div>
    <!-- Content -->
    <div id="content">
	<div align="center" style="margin-left:20px; padding-top:40px; height:400px; line-height:2.5em;">
     	 <h2>Registration Form</h2>
	        <br />
	        <form action="storescripts/register_script.php" name="myForm" method="post">
			 <table border="0">
			 	<tr><td>Username:</td><td>
			 		<input type="text" name="username" maxlength="60" size="40">
			 	</td></tr>
			 	<tr><td>Password:</td><td>
			 		<input type="password" name="pass" maxlength="10" size="40">
			 	</td></tr>
			 	<tr><td>Confirm Password:</td><td>
			 		<input type="password" name="pass2" maxlength="10" size="40">
			 	</td></tr>
			 	<tr><td>First Name:</td><td>
			 		<input type="text" name="fname" maxlength="255" size="40">
			 	</td></tr>
			 	<tr><td>Last Name:</td><td>
			 		<input type="text" name="lname" maxlength="255" size="40">
			 	</td></tr>
			 	<tr><td>Address:</td><td>
			 		<input type="textarea" name="addr" maxlength="255" size="40">
			 	</td></tr>
			 	<tr><td>Email:</td><td>
			 		<input type="text" name="email" maxlength="255"size="40">
			 	</td></tr>
			 	<tr>
				<th>&nbsp;</th>
				<th><input type="submit" name="submit" value="Register" onclick="javascript:return validateMyForm();" ></th>
				</tr> 
			</table>
			</form>
 		</div>
    </div>
    <!-- End Content -->
    <!-- Sidebar -->
    <div id="sidebar">
      <!-- Login/Register -->
<!-- if no user log on show below-->
      <div class="box login">
        <h2>User Account<span></span></h2>
        <div align="center"class="box-content">
          <form name="loginReg">
			<p>Already Registered?</p>
			<label style="padding-top:1px; padding-bottom:1px;"><a style="color:#ccc; text-decoration: none;"href="customer_login.php">Login</a></label>
          </form>
        </div>
      </div>

      <!-- End Login -->
    </div>
    <!-- End Sidebar -->
    <div class="cl">&nbsp;</div>
  </div>
  <!-- End Main -->
 
  <!-- Footer -->
  <?php include_once("template_footer.php"); ?>
  <!-- End Footer -->
</div>
<!-- End Shell -->
</body>
</html>
